package com.ruix.app.model;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

/**
 * Created by hadexs on 2017/5/4.
 */

public class WebParcel implements Serializable{

    private String url;
    private String title;
    private String action;
    private JSONObject params;
    private JSONObject getParams;
    private boolean isClassDetail;


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public JSONObject getParams() {
        return params;
    }

    public boolean isClassDetail() {
        return isClassDetail;
    }

    public void setClassDetail(boolean classDetail) {
        isClassDetail = classDetail;
    }

    public void setParams(JSONObject params) {
        this.params = params;
    }

    public void addParams(String key,String value) {
        if (params == null){
            params = new JSONObject();
        }
        try {
            params.put(key,value);
        } catch (JSONException e) {
            e.printStackTrace();
        }

    }

    public void addGetParams(String key,String value) {
        if (getParams == null){
            getParams = new JSONObject();
        }
        try {
            getParams.put(key,value);
        } catch (JSONException e) {
            e.printStackTrace();
        }

    }


}
